package com.lyf.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.lyf.dao.MesssageDao;
import com.lyf.pojo.Message;

@Service
@Transactional
public class MessageService {

	@Autowired
	private MesssageDao dao;
	
	
	public void add(Message message){
		dao.saveOrUpdate(message);
	}


	public List<Message> findAll() {
		return dao.findAllByOrder("desc", "createtime");
	}
	
}
